const fs = require("fs");
const path = require("path");

var filePath = path.join(__dirname, "/1.txt");
var fd = fs.openSync(filePath,"r"); //第一个参数是文件路径，第二个参数是写入内容

var buf = Buffer.alloc(10);
var result = fs.readSync(fd, buf); //把fd读到buf中

console.log(buf.toString("utf-8"));
console.log(result); //个数
